home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir42
/
c7105.zip
/
FILECTRL.TPX
< prev
next >
Wrap
Text File
|
1994-03-02
|
6KB
|
82 lines
#!┌───────────────────────────┤Template Segment├───────────┬─────────────────┐
#!│ FileCtrl.TPX │Version: 3007.105│
#!├───────────────────────────────┤Contents├───────────────┴─────────────────┤
#!│Structure Type Description │
#!│──────────────────── ───────── ─────────────────────────────────────────│
#!│FileControl GROUP Controls the writing of File Control Code│
#!│ScrLookupFileControl GROUP Finds screens fields with lookups │
#!│RelatedFileControl GROUP Finds related (child) files │
#!│WriteFileControl GROUP Writes File Opening/Closing Code │
#!├───────────────────────────────┤Comments├─────────────────────────────────┤
#!│Version Comments │
#!│──────── ────────────────────────────────────────────────────────────────│
#!│3007.000 Release of CDD3 version 3007 templates │
#!└──────────────────────────────────────────────────────────────────────────┘
#!
#GROUP(%FileControl)
#IF(%CloseFiles OR (%FileControlMode='1')) #! If necessary to process
#SET(%OpenedFiles,',') #! Initialize dup tracking
#IF(%Primary) #! IF a primary file defined
#FIX(%File,%Primary) #! FIX for file processing
#INSERT(%WriteFileControl) #! Write F/C Code
#ENDIF #! END (IF a primary...)
#FOR(%Secondary) #! FOR secondary file defined
#FIX(%File,%Secondary) #! FIX for file processing
#INSERT(%WriteFileControl) #! Write F/C Code
#ENDFOR #! END (For secondary...)
#IF(%Screen) #! IF a screen is used
#INSERT(%ScrLookupFileControl) #! Write Screen F/C Code
#ENDIF #! END (IF a screen is used)
#IF(%ControlRelatedFiles) #! IF 1:Many related files
#IF(%FileControlMode=%Null) #! IF writing declarations
#SET(%RefIntFile,%Primary) #! SET for recursive write
#INSERT(%RelatedFileControl) #! Write Related F/C Code
#ENDIF #! END (IF writing dec...)
#ENDIF #! END (IF 1:Many related...)
#ENDIF #! END (IF necessary to ...)
#IF(%FileControlMode<'2') #! IF NOT writing close code
#SET(%FileControlMode,(%FileControlMode+1)) #! Increment control mode
#ENDIF #! END (IF NOT writing...)
#!***************************************************************************
#GROUP(%ScrLookupFileControl) #!Screen File Control Code
#FOR(%ScreenField) #! FOR each screen field
#IF(%ScreenFieldType = 'ENTRY') #! IF an entry field
#FIX(%Field,%ScreenFieldUse) #! FIX to process field
#IF(%FieldLookup) #! IF Must Be In File
#FIX(%File,%FieldLookup) #! FIX for file processing
#INSERT(%WriteFileControl) #! Write F/C Code
#ENDIF #! END (IF Must Be In File)
#ENDIF #! END (IF an entry field)
#ENDFOR #! END (FOR each screen field)
#!***************************************************************************
#GROUP(%RelatedFileControl) #!Related Files File Control
#FOR(%File) #! FOR each file in system
#SET(%ChildPre,('['&%FilePre&']')) #! Prep to search for prefix
#IF((INSTRING(%ChildPre,%RelatedChildList,1,1)))#! IF FILE is child in PROC
#INSERT(%WriteFileControl) #! Write F/C Code
#ENDIF #! END (IF FILE is child...)
#ENDFOR #! END (FOR each file...)
#!***************************************************************************
#GROUP(%WriteFileControl) #!Write File Control Code
#SET(%AddString,(','&%FilePre)) #! To track duplicates
#SET(%SearchString,(%AddString&',')) #! TO search for duplicate
#IF(INSTRING(%SearchString,%OpenedFiles,1,1)='0')#! IF code NOT written for file
#SET(%OpenedFiles,(%AddString&%OpenedFiles)) #! FLAG that code written
#IF(%FileControlMode=%Null) #! IF declaring flags
%FilePre::Opened BYTE #<! TRUE is PROC opens file
#ELSIF(%FileControlMode='1') #! ELSE IF opening files
#IF(%CloseFiles) #! IF closing opened files
%FilePre::Opened = CheckOpen(%File) #<! Open file if necessary
#ELSE #! ELSE (NOT closing...)
CheckOpen(%File) #<! Open file if necessary
#ENDIF #! END (IF closing opened...)
#ELSIF(%FileControlMode='2') #! ELSE IF closing files
IF %FilePre::Opened THEN CLOSE(%File). #<! IF opened, close file
#ELSE #! ELSE IF other mode
#SET(%ErrorMessage, (%Procedure & ' ERROR: Unknown Form Opens Mode:' & %FileControlMode))
#ERROR(%ErrorMessage) #! POST error to user
#ENDIF #! END (IF F/C Mode...)
#ENDIF #! END (IF code NOT...)
#!***************************************************************************
#CHAIN('Relation.tpx')